import request from "../utils/request";

export const getDustbinCategories = (currentPage, size, id) => {
  return request.connection("get", `/dustbin/categories`, {
    currentPage: currentPage,
    size: size,
    id: id,
  });
};

export const searchDistbinCategories = (currentPage, size, name, id) => {
  return request.connection("get", `/dustbin/searchDustbinCategories`, {
    currentPage: currentPage,
    size: size,
    name: name,
    id: id,
  });
};

export const recoverCategory = (id) => {
  return request.connection("put", `/dustbin/recoverDustbinCategory/${id}`);
};

export const getDustbinBlogs = (currentPage, size, id) => {
  return request.connection("get", `/dustbin/blogs`, {
    currentPage: currentPage,
    size: size,
    id: id,
  });
};

export const searchDustbinBlogs = (
  title,
  description,
  content,
  currentPage,
  size,
  id
) => {
  return request.connection("get", `/dustbin/searchDustbinBlogs`, {
    title: title,
    description: description,
    content: content,
    currentPage: currentPage,
    size: size,
    id: id,
  });
};

export const recoverBlog = (id) => {
  return request.connection("put", `/dustbin/recoverDustbinBlog/${id}`);
};
